import 'package:flutter/material.dart';
import 'package:flutter_douban/main_page/class/provider/class_provider_model.dart';
import 'package:flutter_douban/main_page/collect/provider/collection_count_model.dart';
import 'package:flutter_douban/main_page/home/detail/page/cook_detail_page.dart';
import 'package:flutter_douban/main_page/store/provider/store_count_model.dart';
import 'package:flutter_douban/tool_views/text_page.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';

import 'config/app_thumb.dart';
import 'main_page/class/provider/class_dateil_provider.dart';
import 'main_page/tabbar_page.dart';
import 'main_page/transit_page.dart';


void main() {

  /// 单个provider
  // runApp(ChangeNotifierProvider<StoreCountModel>.value(//1
  //   value: StoreCountModel(0,[]),
  //   child: MyApp(),
  // ));

  /// 多个providers
  runApp(
    MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (_) => StoreCountModel(0,[])),
        ChangeNotifierProvider(create: (_) => CollectionCookModel([])),
        ChangeNotifierProvider(create: (_) => ClassProviderModel()),
        ChangeNotifierProvider(create: (_) => ClassDetailProvider()),
      ],
      child: MyApp(),
    ),
  );
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
        designSize: Size(750, 1334),
        builder: (BuildContext context, Widget? child) => MaterialApp(
          /// 根目录
          // initialRoute: '/',
          // routes: {
          //   /// 首页
          //   '/': (context) => TabbarPage(),
          //   /// 做饭详情界面
          //   'cook/detail': (context) => CookDetailPage(),
          // },
          home: TransitPage(),
          debugShowCheckedModeBanner: false, // 隐藏debug 图标
          title: '',
          theme: theme,
        ));
  }
}

enum PlayType {
  network,
  asset,
  file,
  fileId,
}




